***********************
* 2011 emissions
***********************
clear all
version 11
set more off
set memory 400m
cd ~\20_emission_county_level

insheet using emission_county_level_2011.csv, names comma clear
ren state_and_county_fips_code fips

tab tier_1_description
tab tier1
drop if tier1==13

collapse (sum) total_emissions, by(fips pollutant_cd)
tab pollutant_cd
drop if pollutant_cd=="CO"
drop if pollutant_cd=="PM10-FIL"
drop if pollutant_cd=="PM10-PRI"
drop if pollutant_cd=="PM25-FIL"
replace pollutant_cd="PM25" if pollutant_cd=="PM25-PRI"
reshape wide total_emissions, i(fips) j(pollutant_cd) string
ren total_emissionsNH3 nh3
ren total_emissionsNOX nox
ren total_emissionsPM25 pm25
ren total_emissionsSO2 so2
ren total_emissionsVOC voc

codebook fips
drop if fips==.
codebook fips

compress
saveold emission_county_level_2011, replace

